import { request } from 'umi';

import { Get, fetchApi } from './api';
interface loginParams {
  username: String,
  password: String
}
export async function queryUsers(params: loginParams) {
  return Get('/users', params);
}
export async function adminLogin(params: loginParams) {
  return fetchApi({
    url: '/login',
    method: 'post',
    params: params
  });
}

export async function queryCurrent() {
  return request<API.CurrentUser>('/api/currentUser');
}

export async function queryNotices(): Promise<any> {
  return request('/api/notices');
}
